
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title> 方剂 </title>
  <link rel="stylesheet" type="text/css" href="/css/style.css" />

  <style type="text/css">
    *, body {
      margin: 0px;
      font-family: '微软雅黑';
    }
  </style>
  <script src="~/js/jquery-1.10.2.min.js"></script>
  <script src="~/js/generic.js"></script>
  <script src="~/js/fypage.js"></script>
</head>

<body>
@Html.Partial("top")

<table class="maintable">
  <tr>
    @Html.Partial("menu")
    <td class="rightmaintd" valign="top">
      <div class="searchdiv">
        <a href="/fjgl/list">&lt; 返回</a> &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp;
        方剂名称 <input type="text" id="jingfangming" class="textinput_chaxun">  &nbsp; &nbsp; &nbsp; &nbsp;
        来源 <input type="text" id="laiyuan" class="textinput_chaxun">  &nbsp; &nbsp; &nbsp; &nbsp;
        剂型 <select id="jixing">
        <option value="">请选择</option>
        <option value="汤">汤</option>
        <option value="丸">丸</option>
        <option value="散">散</option>
        <option value="膏">膏</option>
        <option value="丹">丹</option>
        <option value="茶">茶</option>
        <option value="露">露</option>
        <option value="锭">锭</option>
        <option value="酒">酒</option>
        <option value="条">条</option>
        <option value="线">线</option>
        <option value="洗">洗</option>
        <option value="搽">搽</option>
        <option value="栓">栓</option>
      </select>    &nbsp; &nbsp; &nbsp; &nbsp;
        主治 <input type="text" id="zhuzhi" class="textinput_chaxun">  &nbsp; &nbsp; &nbsp; &nbsp;
        <input type="button" value="查询方剂" class="chaxunbtn" onclick="search();">                </div>
      <table class="neirontbiao" id="tbl_list"></table>

      <div class="pagediv" id="pager">
      </div>

    </td>
  </tr>
</table>

@Html.Partial("bottom")

</body>
</html>
<script type="text/javascript">
  var usertype = "@type";
  var submit = false;
  var pager;
  $(document).ready(function () {
    $("#jingfangming").val(decodeURI(util.getUrlParam("jingfangming")));
    pager = new Fypager("pager", getList);
    getList();

  });


  function search() {
    pager.goPage(1);
  }

  function getList() {
    var url = "/fjgl/GetList?pageIndex=" + pager.currPage;
    util.getJSON(url, { "jingfangming": $("#jingfangming").val(), "laiyuan": $("#laiyuan").val(), "jixing": $("#jixing").val(), "zhuzhi": $("#zhuzhi").val() }, function (json) {
      if (json.status == 0) {
        pager.showPager(json.totalPage, json.totalNum);
        showList(json.list);
      } else {
        alert(json.msg);
      }
    });
  }

  function showList(list) {
    var html = '<tr class="neirontbiaotou"><td width="13%">方剂名</td><td width="10%">来源</td><td width="10%">医家流派</td><td width="10%">剂型</td><td width="25%">主治</td><td width="10%">录入人</td><td width="6%">审核</td></tr>';
    if (list.length == 0) {
      html += '<tr><td colspan="7" style="text-align:center;height:50px;">暂无方剂信息</td></tr>';
    }
    for (var i = 0; i < list.length; i++) {
      html += '<tr>';
      html += '<td title="' + list[i].jingfangming + '">' + util.formateTitle(list[i].jingfangming, 10, true) + '</td>';
      html += '<td>' + util.FormateNull(list[i].laiyuan) + '</td>';
      html += '<td>' + util.FormateNull(list[i].liupai) + '</td>';
      html += '<td>' + util.FormateNull(list[i].jixing) + '</td>';
      html += '<td title="' + list[i].zhuzhi + '">' + util.formateTitle(list[i].zhuzhi, 8, true) + '</td>';
      html += '<td>' + util.FormateNull(list[i].createuser) + '</td>';
      html += '<td>' + util.FormateNull(list[i].shenhe) + '</td>';
    }
    $("#tbl_list").html(html);
  }
</script>